package com.wsx.ones.cloud.es;

import org.elasticsearch.client.Client;
import org.elasticsearch.common.settings.Settings;

import java.util.Map;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ConcurrentHashMap;

/**
 * 获得client的核心操作类
 * Created by wangshuaixin on 17/6/4.
 */
public class EsClientHelper {

    private volatile Settings settings;

    private Map<String, ArrayBlockingQueue<Client>> clients = new ConcurrentHashMap<String, ArrayBlockingQueue<Client>>();

    private final static String CLUSTER = "wsx-cluster";

    /**
     * 私有构造函数
     */
    private EsClientHelper() {
        initProperties();
    }

    private void initProperties() {

        settings = Settings.builder()
                    .put("cluster.name", CLUSTER)
                    .put("client.transport.sniff", Boolean.TRUE)
                    .build();
    }


}
